home *** CD-ROM | disk | FTP | other *** search
- unit LVItem;
-
- interface
-
- uses
- ComObj, ActiveX, ComCtrls, LVCtrl_TLB, StdVcl, AxCtrls;
-
- type
- TListItem = class(TAutoIntfObject, IListItem)
- private
- FListItem: ComCtrls.TListItem;
- protected
- function Get_Caption: WideString; safecall;
- function Get_Index: Integer; safecall;
- function Get_SubItems: IStrings; safecall;
- procedure Set_Caption(const Value: WideString); safecall;
- procedure Set_SubItems(const Value: IStrings); safecall;
- function Get_Checked: WordBool; safecall;
- procedure Set_Checked(Value: WordBool); safecall;
- public
- constructor Create(AOwner: ComCtrls.TListItem);
- end;
-
- implementation
-
- uses ComServ;
-
- constructor TListItem.Create(AOwner: ComCtrls.TListItem);
- begin
- inherited Create(ComServer.TypeLib, IListItem);
- FListItem := AOwner;
- end;
-
- function TListItem.Get_Caption: WideString;
- begin
- Result := FListItem.Caption;
- end;
-
- function TListItem.Get_Index: Integer;
- begin
- Result := FListItem.Index;
- end;
-
- function TListItem.Get_SubItems: IStrings;
- begin
- GetOleStrings(FListItem.SubItems, Result);
- end;
-
- procedure TListItem.Set_Caption(const Value: WideString);
- begin
- FListItem.Caption := Value;
- end;
-
- procedure TListItem.Set_SubItems(const Value: IStrings);
- begin
- SetOleStrings(FListItem.SubItems, Value);
- end;
-
- function TListItem.Get_Checked: WordBool;
- begin
- Result := FListItem.Checked;
- end;
-
- procedure TListItem.Set_Checked(Value: WordBool);
- begin
- FListItem.Checked := Value;
- end;
-
- end.
-